(function() {
    'use strict';

    angular
        .module('travelApp')
        .controller('OpinionDetailController', OpinionDetailController);

    OpinionDetailController.$inject = ['$scope', '$rootScope', '$stateParams', 'entity', 'Opinion'];

    function OpinionDetailController($scope, $rootScope, $stateParams, entity, Opinion) {
        var vm = this;
        vm.opinion = entity;
        
        var unsubscribe = $rootScope.$on('travelApp:opinionUpdate', function(event, result) {
            vm.opinion = result;
        });
        $scope.$on('$destroy', unsubscribe);

    }
})();
